package cn.yuanqiao.archive.shuzihua.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * 目录导入日志对象 YQ_CATALOG
 *
 * @ProjectName: cn.yuanqiao.archive.shuzihua.domain
 * @ClassName: YqCatalog
 * @Author: lenovo
 * @Description: hbWang
 * @Date: 2024/1/17 09:59
 * @Version: 1.0
 **/
public class YqCatalog extends BaseEntity {
    private static final long serialVersionUID = 1L;

    private String tableName;
    private final String BIGTABLENAME = "_YQ_CATALOG";

    public YqCatalog() {
        String tenantCode = SecurityUtils.getTenantCode();
        if (StringUtils.isEmpty(tenantCode)) {
            throw new ServiceException("tenantCode is null");
        } else {
            this.tableName = tenantCode.toUpperCase() + BIGTABLENAME;
        }
    }

    /**
     * 主键
     */
    private String id;

    /**
     * 失败条数
     */
    @Excel(name = "失败条数")
    private String failNum;

    /**
     * 成功条数
     */
    @Excel(name = "成功条数")
    private String successNum;

    /**
     * 错误信息
     */
    @Excel(name = "错误信息")
    private String msg;

    /**
     * 门类cod
     */
    @Excel(name = "门类cod")
    private String categoryCode;

    /**
     * 创建人id
     */
    @Excel(name = "创建人id")
    private String creatorId;

    /**
     * 失败数据
     */
    @Excel(name = "失败数据")
    private String failData;

    /**
     * 菜单
     */
    @Excel(name = "菜单")
    private String importWay;

    /**
     * 状态 0成功 1 失败
     */
    @Excel(name = "状态 0成功 1 失败")
    private String state;

    /**
     * 批次号
     */
    @Excel(name = "批次号")
    private String batchNum;

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setFailNum(String failNum) {
        this.failNum = failNum;
    }

    public String getFailNum() {
        return failNum;
    }

    public void setSuccessNum(String successNum) {
        this.successNum = successNum;
    }

    public String getSuccessNum() {
        return successNum;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public void setCategoryCode(String categoryCode) {
        this.categoryCode = categoryCode;
    }

    public String getCategoryCode() {
        return categoryCode;
    }

    public void setCreatorId(String creatorId) {
        this.creatorId = creatorId;
    }

    public String getCreatorId() {
        return creatorId;
    }

    public void setFailData(String failData) {
        this.failData = failData;
    }

    public String getFailData() {
        return failData;
    }

    public void setImportWay(String importWay) {
        this.importWay = importWay;
    }

    public String getImportWay() {
        return importWay;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public void setBatchNum(String batchNum) {
        this.batchNum = batchNum;
    }

    public String getBatchNum() {
        return batchNum;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("failNum", getFailNum())
                .append("successNum", getSuccessNum())
                .append("msg", getMsg())
                .append("categoryCode", getCategoryCode())
                .append("creatorId", getCreatorId())
                .append("createTime", getCreateTime())
                .append("failData", getFailData())
                .append("importWay", getImportWay())
                .append("state", getState())
                .append("batchNum", getBatchNum())
                .toString();
    }
}
